UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EmFBpvXG7le5KPUqPY77gSpCB1T1RLfRYER5kfL4des='
WHERE
key_id = 'a31f58b212456f49c8ab55d9c54db67592d1140d8935b3df0fa54cf9ae1f301e'
AND (
token = 'EmFBpvXG7le5KPUqPY77gSpCB1T1RLfRYER5kfL4des='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)