UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FFd4ouK52B6W8GaK/jXIM3Mn9DRWmUU5/HW+6B8zflE=' 
WHERE 
  key_id = 'dfa02f9af924254972f23557b73281af2e3b83a2738cfab2e2ea4f451c5a4936' 
  AND (
    token = 'FFd4ouK52B6W8GaK/jXIM3Mn9DRWmUU5/HW+6B8zflE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039