UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DFgEmY/I63vD63DhBzGcRp05PbkAqQbz9skdC5o6NXo=' 
WHERE 
  key_id = '96c63256aaf6c5f056ed234ae264197cac33926a850a8bf2a99469208573a758' 
  AND (
    token = 'DFgEmY/I63vD63DhBzGcRp05PbkAqQbz9skdC5o6NXo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029