UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nTqCwm0dx4ikSSzhDxD8rVK5Tnktp+0lUHD4cOjD1oU='
WHERE
key_id = '96c8bc4f8b99e57bd28d31ea6edb3cf22af1cc8c8850e7f09d4e165698de92be'
AND (
token = 'nTqCwm0dx4ikSSzhDxD8rVK5Tnktp+0lUHD4cOjD1oU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)