UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Az/cfl4tL1cix71zZ1oY+8v5Bkylw9FnS94dFPByz6Q='
WHERE
key_id = 'cef8adba8af5b69e4aab2090a61d0d785574e9ed0d2c50a4ec4f49c7da94f016'
AND (
token = 'Az/cfl4tL1cix71zZ1oY+8v5Bkylw9FnS94dFPByz6Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)