UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+mtHdFOz1uc7q+jI/4vIj9+VyFVNLNAUhZql1VIfbg4='
WHERE
key_id = '41776f90f8b67ddb3ff97a0b9328f9c2bd39443a500e845f081397797502f1ba'
AND (
token = '+mtHdFOz1uc7q+jI/4vIj9+VyFVNLNAUhZql1VIfbg4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)