UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iy9cHsZP8BUIZuDDDy/3nNOHbwx5oY70eMGw6/9jBK4=' 
WHERE 
  key_id = '3aa693baefc025cec24d52d5de4aa261ac5252284ab42a342189fa8455d6f62d' 
  AND (
    token = 'iy9cHsZP8BUIZuDDDy/3nNOHbwx5oY70eMGw6/9jBK4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050