UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '55gllT+9XuqEoiw3af16h61iMgoj1TXmp5Ferbo39Tg='
WHERE
key_id = 'fdbf7e251443ba12f121cb745ff684dded8c0e3b904fc43742f6b944f467cf99'
AND (
token = '55gllT+9XuqEoiw3af16h61iMgoj1TXmp5Ferbo39Tg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)