UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cyFDr16zKb23mpIkOVT8sKq6Akc/dhpjd9DRM4lteIw=' 
WHERE 
  key_id = '15b4e2f9712608abfb06b5b5d60ba8ab90e0649cf691df4f3204e3f27f2b4555' 
  AND (
    token = 'cyFDr16zKb23mpIkOVT8sKq6Akc/dhpjd9DRM4lteIw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018