UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BJBTbvFUauTPNnAHwWPDDL4VDCxSNH3+APDVvPTbp4k='
WHERE
key_id = '200fc8b3589cf712246a0e1feca4cabca02a0d93ff752ffc5a2e4fd7d069fdb8'
AND (
token = 'BJBTbvFUauTPNnAHwWPDDL4VDCxSNH3+APDVvPTbp4k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)