UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UI6/QqgvwTO6tFrU7n751h+ni7Zjf9dysqkxgBnsBgY='
WHERE
key_id = 'b1d8cd5ab3a7ba8d48a389868f33767ed17e9b3e5c2d7bf8e1de99f76f73a049'
AND (
token = 'UI6/QqgvwTO6tFrU7n751h+ni7Zjf9dysqkxgBnsBgY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)