UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/PFhJNB9ZVbosqIbpYy5ZAkB+VuOIiq+6ywQjVhz+es=' 
WHERE 
  key_id = '29b6ad6211bf83a30df9d7380ca0f77215347d6aedbb3e72c0bcde1f90e5b59f' 
  AND (
    token = '/PFhJNB9ZVbosqIbpYy5ZAkB+VuOIiq+6ywQjVhz+es=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027