UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'umGzVlLirjZdxnRh00xQez5Tsg6BbMlP8WDEpvA4Ork=' 
WHERE 
  key_id = '78d8c48f111d94d27d5e59890332ef88c7ea6d84a552c05d1890cb9096a5e2a9' 
  AND (
    token = 'umGzVlLirjZdxnRh00xQez5Tsg6BbMlP8WDEpvA4Ork=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030