UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wl618F1hc/FlmlBQVeUoF1X34f1KrVBck4QMMLA5Gso=' 
WHERE 
  key_id = 'd56a2d0621565acea3483a9379ccda7467c88d51324a11212fa3a1bde8e94c57' 
  AND (
    token = 'wl618F1hc/FlmlBQVeUoF1X34f1KrVBck4QMMLA5Gso=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037