UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aVW9fl/TqKiXH0zd4flD+t3yCAKwhSLZqAAzcrMFOsY='
WHERE
key_id = 'f536bba2339b73d231b7e12e7c1a46c4f0b3b0f068740315d216dc91aa0ba545'
AND (
token = 'aVW9fl/TqKiXH0zd4flD+t3yCAKwhSLZqAAzcrMFOsY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)