UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F+jHoTrG/2JdQNPB6ja23Fk9ukU5CrGyLFVNwqHHQuY='
WHERE
key_id = 'e314d11249d7296559500bd8e9c17bd1a986a84f7a03f320c53651aaafc7bf45'
AND (
token = 'F+jHoTrG/2JdQNPB6ja23Fk9ukU5CrGyLFVNwqHHQuY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)