UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Pte9RVB/gI5wDE8K8nbs+E6c7mr9iHZ6VhUVubnV96I=' 
WHERE 
  key_id = '55814d157fd36f525f6c92376d35830d178df62e642caec89def31a04d050a23' 
  AND (
    token = 'Pte9RVB/gI5wDE8K8nbs+E6c7mr9iHZ6VhUVubnV96I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033