UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/5I6Q/nIjH6Bu1gXA1AVN7V7O5XWj5gH1naUbLoxrJk=' 
WHERE 
  key_id = '00d259a94a4f16281844fd9426b5827dab58614cffbd2f2db9ff6941c267e040' 
  AND (
    token = '/5I6Q/nIjH6Bu1gXA1AVN7V7O5XWj5gH1naUbLoxrJk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027