UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G6g7dAMgcAuea3v9dFtZCAgic7xgzJCONl3I/ugDVpY='
WHERE
key_id = 'c7285352af0081178319a47a9d3b0ed02e7845bd731515042222a752d52984b4'
AND (
token = 'G6g7dAMgcAuea3v9dFtZCAgic7xgzJCONl3I/ugDVpY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)