UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PnXOXtK6fDLjfR/bhtHPryLY3LDSHmhYiMRSIXrKgxM='
WHERE
key_id = 'aa3907e5943ffcce8900bd63328fc39b706fcede6d61cbf8c245d5eada9b4026'
AND (
token = 'PnXOXtK6fDLjfR/bhtHPryLY3LDSHmhYiMRSIXrKgxM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)