UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SIvHRnuTK7VLBBYBZ2Tjqxi8uNW9NsYjkvHK26AVQqc='
WHERE
key_id = '391d32c437b6ebaa888db50d10d4bbd69be93ff807a8926df0221d90161f7b6b'
AND (
token = 'SIvHRnuTK7VLBBYBZ2Tjqxi8uNW9NsYjkvHK26AVQqc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)