UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oNBSFPhxIvyXZckmUWkY4e1yRjI3a5nNy+6EgW0Kf+w='
WHERE
key_id = '7e3aedf9ae4562f646cb68f191e5d6be904d7e1dbc5b051aad4ac5f6e82b6ed8'
AND (
token = 'oNBSFPhxIvyXZckmUWkY4e1yRjI3a5nNy+6EgW0Kf+w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)