UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'y/1AKJryT8+1Pde8ZB4pYbw1A6OQtawzZq9ZKTelhNk=' 
WHERE 
  key_id = '7cd333ba9c60a509b9e7d6bd8ba92c92f814387074353bca07e883cbd624ad57' 
  AND (
    token = 'y/1AKJryT8+1Pde8ZB4pYbw1A6OQtawzZq9ZKTelhNk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041