UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'c8isZp9pTzF0/QGWnjrVwLqvytgIXtf2xlZ7yO7aYO4='
WHERE
key_id = '4b86d260b423c65a4d46264ea23820b4e8fcfb3f70e2fd86f582c909a09a8b6e'
AND (
token = 'c8isZp9pTzF0/QGWnjrVwLqvytgIXtf2xlZ7yO7aYO4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)