UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WQq1xqwbgpzuFsNFLAaWVMV4DVJCI34DNQDD/TiRIaY='
WHERE
key_id = '7eb3f3008edd8146b68c5b0b0fd9fb95b040dd119a0cee57b7b1a3566d7bf725'
AND (
token = 'WQq1xqwbgpzuFsNFLAaWVMV4DVJCI34DNQDD/TiRIaY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)