UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i6gELQgUlYxWGqLkjq3t2BsDOK39pS+PRxUhiZgsFfc='
WHERE
key_id = 'c8c90204d7bfef040328efe3c7f76ccc9d83e071a2547b27517c2492e247118f'
AND (
token = 'i6gELQgUlYxWGqLkjq3t2BsDOK39pS+PRxUhiZgsFfc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)