UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0zyV3+3xoQxqrDMz1rK6OhfRfcvh8JUoOVXxqXU3rqE='
WHERE
key_id = 'a4d80a185fc3f182ac54928747011d677ee85896e2a2b121acd90ee6be8e22ee'
AND (
token = '0zyV3+3xoQxqrDMz1rK6OhfRfcvh8JUoOVXxqXU3rqE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)