UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'srvlFwZ6S+TXm2LvbQa8jz3YxWyI2PONwJVZgi42xtE='
WHERE
key_id = 'bbc31be6bb8da6dea39d8d48be95975bf60bbb27caa51f1591f579f17d7615c8'
AND (
token = 'srvlFwZ6S+TXm2LvbQa8jz3YxWyI2PONwJVZgi42xtE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)