UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Hll/K+v+7ZnlEaLHimUaqetKTcjzToxfcB9tuD7uXM='
WHERE
key_id = 'd82ae7cb744b963717cb323d66f1c20ba6f47629c8bb0e1741801b1b6b373adf'
AND (
token = '/Hll/K+v+7ZnlEaLHimUaqetKTcjzToxfcB9tuD7uXM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)