UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cnCZD6V7++z5OQQxNfRJZ2jPOKtvIqy2vZQk2tget8w='
WHERE
key_id = '4e21f65fc8f6e6c01619173fc7c03b1c701ab8e775a4e273f01b6c58cf8b5bed'
AND (
token = 'cnCZD6V7++z5OQQxNfRJZ2jPOKtvIqy2vZQk2tget8w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)