UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fz/I/Dlp3Ye2Im+GCdehOSl8G4gMJVEvubI226w/XVM='
WHERE
key_id = '2350994a61c20b30589d97560547a2a228403cc7f328f73d2f5c3d4db23aa1a2'
AND (
token = 'fz/I/Dlp3Ye2Im+GCdehOSl8G4gMJVEvubI226w/XVM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)