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