UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QN17HPwtpwvMw3kP6rF1HwGLTZJIn37cg1TAM2P/5u4='
WHERE
key_id = '570318cdfc14bdf7c88eaed7d102ba0429e6679a979e63c7aa0a80981c9276d3'
AND (
token = 'QN17HPwtpwvMw3kP6rF1HwGLTZJIn37cg1TAM2P/5u4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)