UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9Fyw6c6b6ioUiCO5QZbZmGf5RQI1dGzZZ22RMkq9Fzc=' 
WHERE 
  key_id = '5888b908e1492564766970c0c207bffae728b64cb07ea2b2e061b06d68f05202' 
  AND (
    token = '9Fyw6c6b6ioUiCO5QZbZmGf5RQI1dGzZZ22RMkq9Fzc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034