UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3+KeZoXYme3Cg/N/umduAJsOlZgtGltTFH4O4pVBIqg=' 
WHERE 
  key_id = 'c84e8f2212b23227408f022230e0738e94175f5ddefb6e53d43309327322f16e' 
  AND (
    token = '3+KeZoXYme3Cg/N/umduAJsOlZgtGltTFH4O4pVBIqg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029