UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VrYCB7GOexV+RbwzJFpLYH0m8wLytg5ElphCSw91YU0='
WHERE
key_id = '29e0b509e889dd899642bbd70d6cf7231b5a8ace4d551d6ac85de28aedea0f85'
AND (
token = 'VrYCB7GOexV+RbwzJFpLYH0m8wLytg5ElphCSw91YU0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)