UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fLlRFJVcYRmejAuyEe7cl0QzbNok93dweE7pBhNbibY='
WHERE
key_id = 'f9ad8b3a0f3d82aa2da2c35b2ed95a4e16597925ec43963e1359b17c00bb082b'
AND (
token = 'fLlRFJVcYRmejAuyEe7cl0QzbNok93dweE7pBhNbibY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)