UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zYSvaWqK419QSoz97GP/d+DAzRgzuR40ULS9o3ZMS54='
WHERE
key_id = 'a608deddcfcdae52c90a4fd5d792af2f50e19e22e27003b2f63dbcdc05338913'
AND (
token = 'zYSvaWqK419QSoz97GP/d+DAzRgzuR40ULS9o3ZMS54='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)