UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OQnobkJJn572WlohV+tmUuCevcp3tT1PkEBpct/lY+k='
WHERE
key_id = 'b3fd0a9a7387d9b5405b8b89bc401b088148f812dc2647abbdb55d6f4b8deca0'
AND (
token = 'OQnobkJJn572WlohV+tmUuCevcp3tT1PkEBpct/lY+k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)