UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Q/oarav0dFHsSkPc/FmaJykQtYPwXPVJDPQVvl1x3Hw='
WHERE
key_id = 'b44ad5e7fbeace0d048b5428b7a44a0528e88a9352aa55b2a9cf1d3386e59f39'
AND (
token = 'Q/oarav0dFHsSkPc/FmaJykQtYPwXPVJDPQVvl1x3Hw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)