UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QiSBSofu29C5c7RahOJg6T2eyJ5T83XPBIRkfHswR8g='
WHERE
key_id = '6b2ff005dcb4dd99b3d04bc0c99f4a2aa73bb0544b0b869ce34ca91fb1824a4a'
AND (
token = 'QiSBSofu29C5c7RahOJg6T2eyJ5T83XPBIRkfHswR8g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)