UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kDHzy/uGKLx8NCvYP5NklhyWqLnXzknl4QNey3sAuwU='
WHERE
key_id = '63167b18b38388f386e681ea027e64c38c79512ebe41ab39647ee2f2a963f6e2'
AND (
token = 'kDHzy/uGKLx8NCvYP5NklhyWqLnXzknl4QNey3sAuwU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)