UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1sRyYb72fWzZChWDG+Pxn8/dUt9HhV+av5dOrF4uGfI=' 
WHERE 
  key_id = 'b36d75b794bd97a58b18bab99fe3794fc4a98ef7b0907999e8bb9c5c55e53f7e' 
  AND (
    token = '1sRyYb72fWzZChWDG+Pxn8/dUt9HhV+av5dOrF4uGfI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060