UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C2AqCdTk5Hq2PpcFRiKnFoXU2VXYdlbRH4pbCCk2cNY='
WHERE
key_id = '2206fe4de8309b3f493ef4b428309a221b292260d587e112f58c7b84f9edfb87'
AND (
token = 'C2AqCdTk5Hq2PpcFRiKnFoXU2VXYdlbRH4pbCCk2cNY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)