UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+FIpNV0/KbVWSaDveC9wl+BArPVZNqV3nSBbEVNalR4='
WHERE
key_id = '32d6f48c3bc61a1ae5b643702b4c7854448866e60696621fc41c1e259d7c5194'
AND (
token = '+FIpNV0/KbVWSaDveC9wl+BArPVZNqV3nSBbEVNalR4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)